﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.IO;
using System.Windows.Forms;

namespace CommonLibrary
{
    public delegate void DoSampleEvent();

    public sealed class App
    {
        private static Form m_form = null;

        /// <summary>
        /// 
        /// </summary>
        public static Form MainFrame
        {
            get
            {
                return m_form;
            }
        }

        /// <summary>
        /// 获取应用程序的完整路径
        /// </summary>
        public static string AppFullPath
        {
            get
            {
                AssemblyName name = Assembly.GetExecutingAssembly().GetName();
                return name.CodeBase.Replace("file:///", string.Empty);
            }
        }

        /// <summary>
        /// 获取当前目录
        /// </summary>
        public static string CurrentDirectory
        {
            get
            {
                return Path.GetDirectoryName(AppFullPath);
            }
        }
    }

}


